package handler;

import java.awt.event.KeyEvent;

import data.AngajatiData;

import windows.Ferestre;

public class SetFocusComponent {
	// private String text="";
	private int keyCode = -5;

	public void setKeyCode(int keyCode) {
		this.keyCode = keyCode;
	}

	public void chooseFocusComponent(KeyEvent event, Ferestre fereastra) {
		Handler hand = new Handler();
		AngajatiData angajati = fereastra.getAngajatiData();

		if (keyCode == 10) 
	//		if (event.getSource() == fereastra.getMainFrame()
		//			.getTextField_SchoolName())
				hand.actionPerformed("addSchoolCommand", angajati, fereastra);
			else if (event.getSource() == fereastra.getMainFrame()
					.getAddSchoolButton())
				hand.actionPerformed("addSchoolCommand", angajati, fereastra);
			else if (event.getSource() == fereastra.getMainFrame()
					.getComboBox_Scoala())
				hand.actionPerformed("selectSchoolCommand", angajati, fereastra);
			else if (event.getSource() == fereastra.getMainFrame()
					.getOkButton())
				hand.actionPerformed("selectSchoolCommand", angajati, fereastra);
			else if (event.getSource() == fereastra.getMainFrame()
					.getRemoveSchoolButton())
				hand.actionPerformed("removeSchoolCommand", angajati, fereastra);
		

	}

}
